<template>
	<view class="page">
		<!-- 用户信息 -->
		<view class="user-info">
			<view class="user-data" @click="onUserInfo">
				<view class="portrait-nickname">
					<view class="portrait">
						<image src="/static/touxiang.png" mode=""></image>
					</view>
					<view class="nickname">
						<text>{{myMobile.substr(0,3)+"****"+myMobile.substr(7,11)}}</text>
					</view>
				</view>
				<view class="more">
					<text class="iconfont icon-more"></text>
				</view>
			</view>
		</view>
		<!-- 设置列表 -->
		<view class="setting-list">
			<view class="list" @click="onAddress">
				<view class="title">
					<text>银行卡管理</text>
				</view>
				<view class="more-content">
					<text class="iconfont icon-more more"></text>
				</view>
			</view>
			<view class="list" @click="onSetting('account')">
				<view class="title">
					<text>账户安全</text>
				</view>
				<view class="more-content">
					<text class="content">密码/实名等管理</text>
					<text class="iconfont icon-more more"></text>
				</view>
			</view>
			<view class="list" @click="onSetting('pay')">
				<view class="title">
					<text>支付密码</text>
				</view>
				<view class="more-content">
					<text class="content">修改</text>
					<text class="iconfont icon-more more"></text>
				</view>
			</view>
			<!--view class="list" @click="onSetting('invoice')">
				<view class="title">
					<text>发票</text>
				</view>
				<view class="more-content">
					<text class="content">添加发票</text>
					<text class="iconfont icon-more more"></text>
				</view>
			</view-->
		</view>
		<!-- 提示框 -->
		<DialogBox ref="DialogBox"></DialogBox>
	</view>
</template>

<script>
	var _self,loginRes;
	import { resolveFile, getDirSize, removeDir, formatSize, storage } from '@/components/img-cache';
	export default {
		data() {
			return {
				myMobile : '',
			};
		},
		onLoad(){
			_self = this;
			loginRes = _self.checkLogin();
			if(!loginRes){return;}
			//console.log(loginRes);
			_self.myMobile = loginRes[1];
		},
		onReady(){
			
		},
		methods:{
			/*用户信息点击*/
			onUserInfo(){
				uni.navigateTo({
					url: '/pages/Information/Information'
				})
			},
			/*地址点击*/
			onAddress(){
				uni.navigateTo({
					url: '/pages/AddressList/AddressList',
				})
			},
			/*设置列表点击*/
			onSetting(type){
				switch(type) {
					case 'account':
						uni.navigateTo({
							url: '/pages/AccountSecurity/AccountSecurity'
						})
						break;
					case 'pay':
						uni.navigateTo({
							url: '/pages/PaymentPassword/PaymentPassword'
						})
						break;
				}
			},
		}
	}
</script>

<style scoped lang="scss">
	@import 'AccountInfo.scss';
</style>
